package com.jltx.xq.relaxnewspro.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.jltx.xq.relaxnewspro.R;
import com.jltx.xq.relaxnewspro.adapter.PagerAdapter;
import com.jltx.xq.relaxnewspro.api.ReadingApi;

/**
 * Created by bo on 2017/5/1.
 */

public class BaseReadingFragment extends AbsTopNavigationFragment {
    private PagerAdapter pagerAdapter;
    @Override
    protected PagerAdapter initPagerAdapter() {
        pagerAdapter = new PagerAdapter(getChildFragmentManager(), ReadingApi.Tag_Titles) {
            @Override
            public Fragment getItem(int position) {
                ReadingFragment fragment = new ReadingFragment();
                Bundle bundle = new Bundle();
                bundle.putInt(getString(R.string.id_pos),position);
                bundle.putString(getString(R.string.id_category),ReadingApi.Tag_Titles[position]);
                fragment.setArguments(bundle);
                return fragment;
            }

        };
        return pagerAdapter;
    }
}
